home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F44446_zipWith.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-02-06  |  1.1 KB  |  32 lines

  1. <xsl:stylesheet version="1.0"
  2.  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. >
  4.   <xsl:template name="zipWith">
  5.     <xsl:param name="pFun" select="/.."/>
  6.     <xsl:param name="pList1" select="/.."/>
  7.     <xsl:param name="pList2" select="/.."/>
  8.     <xsl:param name="pElName" select="'el'"/>
  9.  
  10.     <xsl:if test="$pList1 and $pList2">
  11.       <xsl:variable name="vFunResult">
  12.         <xsl:apply-templates select="$pFun">
  13.           <xsl:with-param name="pArg1" select="$pList1[1]"/>
  14.           <xsl:with-param name="pArg2" select="$pList2[1]"/>
  15.         </xsl:apply-templates>
  16.       </xsl:variable>
  17.  
  18.       <xsl:element name="{$pElName}">
  19.         <xsl:copy-of select="$vFunResult"/>
  20.       </xsl:element>
  21.       
  22.       <xsl:call-template name="zipWith">
  23.         <xsl:with-param name="pFun" select="$pFun"/>
  24.         <xsl:with-param name="pList1" select="$pList1[position() > 1]"/>
  25.         <xsl:with-param name="pList2" select="$pList2[position() > 1]"/>
  26.         <xsl:with-param name="pElName" select="'el'"/>
  27.       </xsl:call-template>
  28.     </xsl:if>
  29.   </xsl:template>
  30. </xsl:stylesheet>
  31.  
  32.